Skip to content

Simplify ternary operator#63

Merged
dknogl merged 2 commits intomasterfrom
simplify_ternary_operator
Apr 10, 2026
Merged

Simplify ternary operator#63
dknogl merged 2 commits intomasterfrom
simplify_ternary_operator

Conversation

@SH-Exact
Copy link
Copy Markdown
Contributor

@SH-Exact SH-Exact commented Apr 9, 2026

Summary

This PR simplifies the CASE ternary operator implementation in query filter expressions by moving it from a per-property level to the QueryFilter level.

Motivation

The previous implementation (introduced in #54) embedded the CASE operator deeply into individual filter property types (CaseNode, CaseExpression, InCaseNode) and the THEN/ELSE branches resolved to raw values (strings, numbers, booleans) or nested CaseNodes. That added significant type complexity and lead to less flexibility.

This PR takes a simpler approach: CASE is now a top-level clause in QueryFilter<T> (alongside AND, OR, and NOT), where IF, THEN, and ELSE are all QueryFilter<T> expressions. This makes the feature more composable and consistent with existing logical operators.

Remarks

For reviewing this PR it makes sense to compare it to PR #53 (commit 65ad1ef) since the changes of PR #54 (commit 30d8393) were almost completely reverted.

@dknogl dknogl self-requested a review April 10, 2026 08:38
@dknogl dknogl merged commit ebd6489 into master Apr 10, 2026
8 checks passed
@dknogl dknogl deleted the simplify_ternary_operator branch April 10, 2026 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants